/*
 * dvhp.h
 *
 *  Created on: 30 Oct 2013
 *      Author: Tom Vercauteren
 */

#ifndef DVHP_H_
#define DVHP_H_

#include <string>
#include <ostream>
#include "claplan_print.h"

using std::string;
using std::endl;

/**
 * DVH point
 */
class Dvhp
{
public:
	// weight (importance)
	double w;
	// absolute dose
	double d;
	//  relative volume
	double v;
	// relative region of influence to d
	double r;

	Dvhp() :
			w(0), d(0), v(0), r(0)
	{
	}
	Dvhp(const Dvhp &dvhp)
	{
		if (this != &dvhp) *this = dvhp;
	}

	Dvhp& operator=(const Dvhp &dvhp)
	{
		if (this != &dvhp)
		{
			w = dvhp.w;
			d = dvhp.d;
			v = dvhp.v;
			r = dvhp.r;
		}
		return *this;
	}

	friend std::ostream & operator<<(std::ostream & os, const Dvhp &dvhp)
	{
		double tmp[4];
		tmp[0] = dvhp.w;
		tmp[1] = dvhp.d;
		tmp[2] = dvhp.v;
		tmp[3] = dvhp.r;
		print_kv<string, double>(os, "dvhp", tmp, 4);
		return os;
	}
};

#endif /* DVHP_H_ */
